feat: fill tail with zeros during normalization#202
Open
john-halloran wants to merge 2 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #202 +/- ##
==========================================
- Coverage 77.50% 75.60% -1.90%
==========================================
Files 3 3
Lines 40 41 +1
==========================================
Hits 31 31
- Misses 9 10 +1 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a
feattechnically, but will act as more of afix. The original MATLABstretched-nmfincluded a toggle calledfillzerothat I did not understand or think was important, and therefore didn't implement. Detailed investigation of why we still had worse performance showed this was one of the big reasons.The
fillzerofeature is enabled during normalization and means that whencomponentsis being stretched, the optimizer treats the area beyond the end of the signal as equaling zero, instead of repeating the final value. When it repeated values, this artificially inflated component intensity at the left and right edges. This, in turn, had cascading effects across theweightsandstretchthat made them wrong, too. The effect was most extreme during normalization because of the dramatic change in signal magnitude that occurs.Note that although it looks like one, this isn't intended to be something the user will need to change. It's implemented this way because it matches the MATLAB and fixed normalization issues. In a future PR, I will likely refactor this to be natively part of the algorithm. That will happen as part of a broader cleanup of the normalization process, which currently is entangled in a way that I don't like.